<?php
########################################################
# DMS Donations Management System v1.0                 #
# created by:  Isaac Sabas                             #
#			   Nikko Reyes							   #
#			   Miko Tiamwatt						   #
#                                                      #
# De La Salle Philippines                              #
# All Rights Reserved DLSP Copyright 2009              #
########################################################

define('ACCESS', true);	

session_start();	
	
# set error checking levels #	
	# enable these lines when site is to be deployed #	
	ini_set('error_reporting', E_ALL);
    ini_set('display_errors', 'On');
    //ini_set('log_errors', 'On');
    //ini_set('error_log', '/usr/local/apache/logs/error_log');
	
	#############################
	# include some needed files #
	#############################
		$absRoot = '../../';
		include($absRoot . 'lib/XAJAX/xajax_core/xajax.inc.php');
		include($absRoot . 'src/ClientHandle.php');

	$id = $_GET["client_id"];
	
	$client = new ClientHandle();	
?>

<html>
<head>
<script>

function changeurl()
{

if( document.getElementById('Type').value == "Phones")
document.getElementById('client_edit_contact_<?php echo $id; ?>').src='../../dashboard/contents/clientEditPhones.php?client_id=<?php echo $id; ?>';

else
if( document.getElementById('Type').value == "Mobile")
document.getElementById('client_edit_contact_<?php echo $id; ?>').src='../../dashboard/contents/clientEditMobiles.php?client_id=<?php echo $id; ?>';

}	

</script>
	<link rel="stylesheet" type="text/css" href="../../lib/YUI/yui/build/fonts/fonts-min.css" />
	
</head>
<body onload="changeurl();">											

<form id="EditClientPhones" action="#" method='post'>

<?php

$phones="";
$mobiles="";

$MobilesArray=$client->getMobileNumbers($id);
$PhonesArray=$client->getPhoneNumbers($id);

if(!$PhonesArray)
{
$phones="disabled";
$mobiles="selected";
}
else if(!$MobilesArray)
{
$phones="selected";
$mobiles="disabled";
}

?>

	<tr>
	<td>
	Phone Type:</td>
	<td>
			<select id="Type" name="Type" onChange="changeurl();">
			<option id="Phones" value="Phones" <?php echo $phones; ?>>Phones</option>
			<option id="Mobile" value="Mobile" <?php echo $mobiles; ?>>Mobile</option>
		</select>
	</td>
	</tr>
	<tr>
	</tr>
	<tr>
	</tr>
	<tr>
<iframe id='client_edit_contact_<?php echo $id; ?>' name='client_edit_contact_<?php echo $id; ?>' src='' width=290 height=250 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=auto style='overflow-x: hidden;'></iframe>
	</tr>
</table>


<div id='Status'></div>

</body>

</html>